From 815881c27580cffd715e2c4e52d2d23dac8e99e3 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 14 Sep 2009 13:43:46 +0000 Subject: [PATCH] Add 'targetlocation' option to skytraq. --- skytraq.c | 35 +++++++++++++++++++ .../options/skytraq-targetlocation.xml | 18 ++++++++++ xmldoc/formats/skytraq.xml | 4 +-- 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 xmldoc/formats/options/skytraq-targetlocation.xml diff --git a/skytraq.c b/skytraq.c index 8918d1c3e..70dc6518b 100644 --- a/skytraq.c +++ b/skytraq.c @@ -26,6 +26,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA + + 2009-09-06 | Josef Reisinger | Added "set target location", i.e. -i skytrag,targetlocation=: */ #include @@ -64,6 +66,7 @@ static char *opt_erase; /* erase after read? (0/1) */ static char *opt_initbaud; /* baud rate used to init device */ static char *opt_dlbaud; /* baud rate used for downloading tracks */ static char *opt_read_at_once; /* number of sectors to read at once (Venus6 only) */ +static char *opt_set_location; /* set if the "targetlocation" options was used */ static arglist_t skytraq_args[] = { @@ -75,6 +78,8 @@ arglist_t skytraq_args[] = { "230400", ARGTYPE_INT, "4800", "230400" }, { "read-at-once", &opt_read_at_once, "Number of sectors to read at once (Venus6 only)", "255", ARGTYPE_INT, "0", "255" }, + { "targetlocation", &opt_set_location, "Set location finder target location as lat,lng", + "", ARGTYPE_STRING, "", "" }, ARG_TERMINATOR }; @@ -998,6 +1003,32 @@ skytraq_erase() return res_OK; } +static void +skytraq_set_location(void) +{ + double lat, lng; + int i; + gbuint8 MSG_SET_LOCATION[17] = { 0x36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + gbuint8 MSG_GET_LOCATION = 0x35; + + db(3, MYNAME ": set_location='%s'\n", opt_set_location); + + sscanf(opt_set_location, "%lf:%lf", &lat, &lng); + le_write_double(&MSG_SET_LOCATION[1], lat); + le_write_double(&MSG_SET_LOCATION[9], lng); + for (i=0; irte_name = xstrdup("SkyTraq tracklog"); track->rte_desc = xstrdup("SkyTraq GPS tracklog data"); diff --git a/xmldoc/formats/options/skytraq-targetlocation.xml b/xmldoc/formats/options/skytraq-targetlocation.xml new file mode 100644 index 000000000..b00e9f633 --- /dev/null +++ b/xmldoc/formats/options/skytraq-targetlocation.xml @@ -0,0 +1,18 @@ + + The device provides a location finder built from eight LEDs and can use + those LEDs to guide you to a location. You can set the target location + with the 'targetlocation' option. Use ':' as the delimiter between latitude + and longitude. + + + Set the target location of the Skytraq location finder + + gpsbabel -i skytraq,targetlocation=12.34:-56.78 -f /dev/ttyUSB +0 -o unicsv -F - + Sets latitude and longitude of the location finder to N12.34 and + W56.78 re ectivly. + The arrows on the device will point you to this location as soon as + it h as a satlitte fix. + + + diff --git a/xmldoc/formats/skytraq.xml b/xmldoc/formats/skytraq.xml index 204cf611b..543d5bd34 100644 --- a/xmldoc/formats/skytraq.xml +++ b/xmldoc/formats/skytraq.xml @@ -32,8 +32,8 @@ use this format to read its memory. Polaris Travel Honey - untested - untested + up to 230400 + 9600 Pearl Diffusion -- 2.30.2